package mybox.junit;

import java.io.IOException;

import mybox.engine.Arc;
import mybox.engine.File4Qcad;
import mybox.engine.QVector;
import mybox.engine.ReferenceIOutput;
import junit.framework.TestCase;

public class ArcTC extends TestCase {
	
	public void test_Arc1() {
		QVector center = new QVector(0,0);
		QVector begin = new QVector(10,0);
		QVector end   = new QVector(0,10);
		assertEquals(Arc.antiClockWiseDiff(center, begin, end),Math.PI/2);
	}
	
	public void test_Arc2() {
		QVector center = new QVector(0,0);
		QVector begin = new QVector(10,10);
		QVector end   = new QVector(-10,10);
		assertEquals(Arc.antiClockWiseDiff(center, begin, end),Math.PI/2);
	}
	
	public void test_Arc3() {
		QVector center = new QVector(0,0);
		QVector begin = new QVector(0,10);
		QVector end   = new QVector(-10,0);
		assertEquals(Arc.antiClockWiseDiff(center, begin, end),Math.PI/2);
	}
	
	public void test_Arc4() {
		QVector center = new QVector(0,0);
		QVector begin = new QVector(-10,0);
		QVector end   = new QVector(0,-10);		
		assertEquals(Arc.antiClockWiseDiff(center, begin, end),Math.PI/2);
	}
	
	public void test_Arc4a() {
		QVector center = new QVector(0,0);
		QVector begin = new QVector(-10,-10);
		QVector end   = new QVector(10,-10);		
		assertEquals(Arc.antiClockWiseDiff(center, begin, end),Math.PI/2);
	}
	
	public void test_Arc5() {
		QVector center = new QVector(0,0);
		QVector begin = new QVector(0,-10);
		QVector end   = new QVector(10,0);		
		assertEquals(Arc.antiClockWiseDiff(center, begin, end),Math.PI/2);
	}
	
	public void test_Arc6() {
		QVector center = new QVector(0,0);
		QVector begin = new QVector(10,-10);
		QVector end   = new QVector(10,10);		
		assertEquals(Arc.antiClockWiseDiff(center, begin, end),Math.PI/2);
	}
	
	public void test_ArcArc() throws SecurityException, IOException {
		File4Qcad file4qcad = new File4Qcad(ReferenceIOutput.testoutputFile());		
		QVector center = new QVector(0,0);
		QVector begin = new QVector(10,10);
		QVector end = new QVector(-10,10);
		int aufloesung=20;
		Arc arc = new Arc(file4qcad, center,begin,end,aufloesung);
		arc.draw();
		file4qcad.close();
	}

}
